TCP: fix timestamp negotiation, RFC6298 compliance, TCP zero-window probe#36
Open
danielinux wants to merge 21 commits intowolfSSL:masterfrom
Open
TCP: fix timestamp negotiation, RFC6298 compliance, TCP zero-window probe#36danielinux wants to merge 21 commits intowolfSSL:masterfrom
danielinux wants to merge 21 commits intowolfSSL:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates wolfIP’s TCP behavior to only include the TCP Timestamp (TS) option in ACKs and data segments when TS has been negotiated, and expands TCP reliability logic around RTO/persist handling.
Changes:
- Gate TS option emission (ACK options, SYN/SYN-ACK TS inclusion, and data segment TS inclusion) on per-socket TS negotiation state (
ts_enabled/ts_offer). - Introduce RFC 6298-style RTO computation (SRTT/RTTVAR), Karn’s algorithm (skip RTT samples for retransmitted segments), and control-segment RTO handling for SYN/FIN states.
- Add TCP persist timer + zero-window probing and corresponding unit tests; update README to mention RTO computation support.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/wolfip.c | Implements TS negotiation gating; adds RTO/persist/control-RTO logic and new TCP socket fields/flags. |
| src/test/unit/unit.c | Adds/updates unit tests for control RTO, RFC6298 RTO updates, TS omission when not negotiated, and persist probing. |
| README.md | Documents retransmission timeout (RTO) computation support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fixed bug in smooth average RTT calculation - Actually assign calculated RTO value (previously fixed to 1s) - Enforce min/max RTO according to RFC - Enforce Karn to only account for new ACK in RTO calculation
9591b9b to
f6c68e2
Compare
- Fixed bug in smooth average RTT calculation - Actually assign calculated RTO value (previously fixed to 1s) - Enforce min/max RTO according to RFC - Enforce Karn to only account for new ACK in RTO calculation
Only send ACKs with TS option if negotiated.
Fix: probe_seq may be set to snd_una when snd_una falls within an existing queued segment
Proper clean-up on close: Manage ACK in TCP_LAST_ACK state.
TCP_LAST_ACK in tcp_input() will process ACKs via tcp_ack() This ensures socket close and control-RTO cleanup only happen when ACK actually covers FIN.
Reported by reviewer on this branch in PR wolfSSL#33 TCP_SYN_RCVD was entered without arming control-RTO from tcp_input() Added RTO trigger + unit tests.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Removed duplicated/unreachable branch in ICMP bind - Enforce 100% function coverage in github actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only send ACKs with TS option if negotiated.
Based on previous PR: #35Overrides and includes PR #34 PR #35